const { no, ok, ipv6ToV4, getClientIp } = require('../../utils/utlis');
const messageService = require('../../services/admin/messageService');

module.exports = {
	messageList: async (req, res, next) => {
		try {
			let { pageNum, pageSize, keywords } = req.body;
			let obj = await messageService.messageList(pageNum, pageSize, keywords);
			res.send(ok(obj));
		} catch (error) {
			res.send(no(error.message));
		}
	},
	messageDel: async (req, res, next) => {
		try {
			let { ids } = req.body;
			await messageService.messageDel(ids);
			res.send(ok());
		} catch (error) {
			res.send(no(error.message));
		}
	}
};
